package com.xbdun.web.bmp.error;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.ModelAndView;

import com.xbdun.comweb.bmp.frame.view.BaseErrorViewResolver;
/**
 * 定义错误画面
 * @author zhanggt
 */
@Component
public class Error404 extends BaseErrorViewResolver {
	@Override
	public ModelAndView resolveErrorView(HttpServletRequest request, HttpStatus status, Map<String, Object> model) {
		ModelAndView modeView = super.resolveErrorView(request, status, model);
		//404错误处理
		if(null == modeView && status.equals(HttpStatus.BAD_REQUEST)){
			modeView = new ModelAndView("error/error404");
			modeView.addObject("msg","我是404");
		}
		return modeView;
	}
}
